/**
 */
package org.mro.grib.model.files.secondEdition;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.mro.grib.core.GribException;
import org.mro.grib.core.MessageException;
import org.mro.grib.model.files.secondEdition.sections.BitMapSection;
import org.mro.grib.model.files.secondEdition.sections.DataRepresentationSection;
import org.mro.grib.model.files.secondEdition.sections.DataSection;
import org.mro.grib.model.files.secondEdition.sections.GridDefinitionSection;
import org.mro.grib.model.files.secondEdition.sections.IdentificationSection;
import org.mro.grib.model.files.secondEdition.sections.IndicatorSection;
import org.mro.grib.model.files.secondEdition.sections.LocalUseSection;
import org.mro.grib.model.files.secondEdition.sections.ProductDefinitionSection;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Message</b></em>'.
 * <!-- end-user-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getStartOffset <em>Start Offset</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getEndOffset <em>End Offset</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getIndicatorSection <em>Indicator Section</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getIdentificationSection <em>Identification Section</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getLocalUseSection <em>Local Use Section</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getGridDefinitionSection <em>Grid Definition Section</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getProductDefinitionSection <em>Product Definition Section</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getDataRepresentationSection <em>Data Representation Section</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getBitMapSection <em>Bit Map Section</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.Message#getDataSection <em>Data Section</em>}</li>
 * </ul>
 * </p>
 *
 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage()
 * @model annotation="http://www.eclipse.org/emf/2002/GenModel description='Grib Message Edition 2' note_1='GRIB is the name of a data representation form for general regularly distributed information in binary.' note_2='Data encoded in GRIB consists of a continuous bit-stream made of a sequence of octets (1 octet = 8 bits).' note_3='The octets of a GRIB message are grouped in sections:\r\nSection number \t\t\tName \t\t\t\t\t\t\t\t\t\tContents\r\n0 \t\t\t\t\t\tIndicator section \t\t\u201cGRIB\u201d, discipline, GRIB edition number, length of message\r\n1 \t\t\t\t\t   Identification section \t\tLength of section, section number, characteristics that apply to all\r\n\t\t\t\t\t\t\t\t\t\t\t\tprocessed data in the GRIB message\r\n2 \t\t\t\t     Local use section (optional)   Length of section, section number, additional items for local use by\r\n\t\t\t\t\t\t\t\t\t\t\t\toriginating centres\r\n3 \t\t\t\t \t Grid definition section \t\tLength of section, section number, definition of grid surface and\r\n\t\t\t\t\t\t\t\t\t\t\t\tgeometry of data values within the surface\r\n4 \t\t\t\t     Product definition section \tLength of section, section number, description of the nature of the\r\n\t\t\t\t\t\t\t\t\t\t\t\tdata\r\n5 \t\t\t\t    Data representation section \tLength of section, section number, description of how the data\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalues are represented\r\n6 \t\t\t\t\t\tBit-map section \t\tLength of section, section number, indication of presence or absence\r\n\t\t\t\t\t\t\t\t\t\t\t\tof data at each of the grid points, as applicable\r\n7 \t\t\t\t\t\t   Data section \t\t\tLength of section, section number, data values\r\n8 \t\t\t\t\t\t    End section \t\t\t\u201c7777\u201d' note_4='Sequences of GRIB sections 2 to 7, sections 3 to 7 or sections 4 to 7 may be repeated within a single GRIB\r\nmessage. All sections within such repeated sequences must be present and shall appear in the numerical\r\norder noted above. Unrepeated sections remain in effect until redefined.' note_5='It will be noted that the GRIB code is not suitable for visual data recognition without computer interpretation.' note_6='The representation of data by means of a series of bits is independent of any particular machine representation.' note_7='(7) Message and section lengths are expressed in octets. Octets are numbered 1, 2, 3, etc., starting at the beginning\r\nof each section. Therefore, octet numbers in a template refer to the respective section.' note_8='Bit positions within octets are referred to as bit 1 to bit 8, where bit 1 is the most significant and bit 8 is the least\r\nsignificant. Thus, an octet with only bit 8 set to 1 would have the integer value 1.' note_9='As used in \u201cGRIB\u201d, \u201cInternational Alphabet No. 5\u201d is regarded as an 8-bit alphabet with bit 1 set to zero.' note_10='The IEEE single precision floating point representation is specified in the standard ISO/IEC 559\u20131985 and ANSI/IEEE\r\n754\u20131985 (R1991), which should be consulted for more details. The representation occupies four octets and is:\r\n\r\nseeeeeee emmmmmmm mmmmmmmm mmmmmmmm\r\nwhere:\r\ns is the sign bit, 0 means positive, 1 negative\r\ne...e is an 8 bit biased exponent\r\nm...m is the mantissa, with the first bit deleted.\r\n\r\nThe value of the number is given by the following table:\r\ne...e \t\t\tm...m \t\t\tValue of number\r\n   0 \t\t\t\t  Any \t\t\t(\u20131)s (m...m)2\u2013232\u2013126 = (\u20131)s(m...m)2\u2013149\r\n1...254 \t\t\t  Any \t\t\t(\u20131)s (1.0 + (m...m)2\u201323)2((e...e)\u2013127)\r\n255 \t\t\t     0 \t\t\tPositive (s=0) or Negative (s=1) infinity\r\n255 \t\t\t   >0 \t\t\tNaN (Not a valid Number, result of illegal operation)\r\n\r\nNormally, only biased exponent values from 1 through 254 inclusive are used, except for positive or negative zero\r\nwhich is represented by setting both the biased exponent and the mantissa to 0.\r\nThe numbers are stored with the high-order octet first. The sign bit will be the first bit of the first octet. The low-order\r\nbit of the mantissa will be the last (eighth) bit of the fourth octet.\r\n\r\nThis floating point representation has been chosen because it is in common use in modern computer hardware.\r\nSome computers use this representation with the order of the octets reversed. They will have to convert the\r\nrepresentation, either by reversing the octets or by computing the floating point value directly using the above\r\nformulas.' regulation_92.1.1='The GRIB code shall be used for the exchange and storage of general regularly distributed\r\ninformation expressed in binary form.' regulation_92.1.2='The beginning and the end of the code shall be identified by 4 octets coded according to\r\nthe International Alphabet No. 5 to represent the indicators \u201cGRIB\u201d and \u201c7777\u201d in Indicator\r\nsection 0 and End section 8, respectively. All other octets included in the code shall\r\nrepresent data in binary form.' regulation_92.1.3='Each section included in the code shall always end on an octet boundary. This rule shall be\r\napplied by appending bits set to zero to the section, where necessary.' regulation_92.1.4='All bits set to \u201c1\u201d for any value indicates that value is missing. This rule shall not apply to\r\npacked data.' regulation_92.1.5='If applicable, negative values shall be indicated by setting the most significant bit to \u201c1\u201d.' regulation_92.1.6='Latitude, longitude and angle values shall be in units of 10\u20136 degree, except for specific\r\ncases explicitly stated in some grid definitions.' regulation_92.1.7='The latitude values shall be limited to the range 0 to 90 degrees inclusive. The orientation\r\nshall be north latitude positive, south latitude negative. Bit 1 is set to 1 to indicate south\r\nlatitude.' regulation_92.1.8='The longitude values shall be limited to the range 0 to 360 degrees inclusive. The orientation\r\nshall be east longitude positive, with only positive values being used.' regulation_92.1.9='The latitude and longitude of the first grid point and the last grid point shall always be given\r\nfor regular grids.' regulation_92.1.10='Vector components at the North and South Poles shall be coded according to the following\r\nconventions.' regulation_92.1.10.1='If the resolution and component flags in section 3 (Flag table 3.3) indicate that the vector\r\ncomponents are relative to the defined grid, the vector components at the Pole shall be\r\nresolved relative to the grid.' regulation_92.1.10.2='Otherwise, for projections where there are multiple points at a given pole, the vector\r\ncomponents shall be resolved as if measured an infinitesimal distance from the Pole at the\r\nlongitude corresponding to each grid point. At the North Pole, the West to East (x direction)\r\ncomponent at a grid point with longitude L shall be resolved along the meridian 90 degrees\r\nEast of L, and the South to North (y direction) component shall be resolved along the\r\nmeridian 180 degrees from L. At the South Pole, the West to East component at a grid point\r\nwith longitude L shall be resolved along the meridian 90 degrees East of L and the South to\r\nNorth component shall be resolved along L.' regulation_92.1.10.3='Otherwise, if there is only one Pole point, either on a cylindrical projection with all but one\r\nPole point deleted, or on any projection (such as polar stereographic) where the Pole maps\r\nto a unique point, the West to East and South to North components shall be resolved along\r\nlongitudes 270\260 and 0\260, respectively at the North Pole and along longitudes 270\260 and 180\260,\r\nrespectively at the South Pole.\r\nNote: This differs from the treatment of the Poles in the WMO traditional alphanumeric codes.' regulation_92.1.11='The first and last grid points shall not necessarily correspond to the first and last data\r\npoints, respectively, if the bit-map is used.' regulation_92.1.12='Items in sections 3 and 4 which consist of a scale factor F and a scaled value V are related\r\nto the original value L as follows:\r\nL \327 10F = V'"
 * @generated
 */
public interface Message extends EObject {
	/**
	 * Returns the value of the '<em><b>Start Offset</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Start Offset</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Start Offset</em>' attribute.
	 * @see #setStartOffset(long)
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_StartOffset()
	 * @model required="true"
	 * @generated
	 */
	long getStartOffset();

	/**
	 * Sets the value of the '{@link org.mro.grib.model.files.secondEdition.Message#getStartOffset <em>Start Offset</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Start Offset</em>' attribute.
	 * @see #getStartOffset()
	 * @generated
	 */
	void setStartOffset(long value);

	/**
	 * Returns the value of the '<em><b>End Offset</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>End Offset</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>End Offset</em>' attribute.
	 * @see #setEndOffset(long)
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_EndOffset()
	 * @model required="true"
	 * @generated
	 */
	long getEndOffset();

	/**
	 * Sets the value of the '{@link org.mro.grib.model.files.secondEdition.Message#getEndOffset <em>End Offset</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>End Offset</em>' attribute.
	 * @see #getEndOffset()
	 * @generated
	 */
	void setEndOffset(long value);

	/**
	 * Returns the value of the '<em><b>Indicator Section</b></em>' containment reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Indicator Section</em>' containment reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Indicator Section</em>' containment reference.
	 * @see #setIndicatorSection(IndicatorSection)
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_IndicatorSection()
	 * @model containment="true" required="true"
	 * @generated
	 */
	IndicatorSection getIndicatorSection();

	/**
	 * Sets the value of the '{@link org.mro.grib.model.files.secondEdition.Message#getIndicatorSection <em>Indicator Section</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Indicator Section</em>' containment reference.
	 * @see #getIndicatorSection()
	 * @generated
	 */
	void setIndicatorSection(IndicatorSection value);

	/**
	 * Returns the value of the '<em><b>Identification Section</b></em>' containment reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Identification Section</em>' containment reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Identification Section</em>' containment reference.
	 * @see #setIdentificationSection(IdentificationSection)
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_IdentificationSection()
	 * @model containment="true" required="true"
	 * @generated
	 */
	IdentificationSection getIdentificationSection();

	/**
	 * Sets the value of the '{@link org.mro.grib.model.files.secondEdition.Message#getIdentificationSection <em>Identification Section</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Identification Section</em>' containment reference.
	 * @see #getIdentificationSection()
	 * @generated
	 */
	void setIdentificationSection(IdentificationSection value);

	/**
	 * Returns the value of the '<em><b>Local Use Section</b></em>' containment reference list.
	 * The list contents are of type {@link org.mro.grib.model.files.secondEdition.sections.LocalUseSection}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Local Use Section</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Local Use Section</em>' containment reference list.
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_LocalUseSection()
	 * @model containment="true"
	 * @generated
	 */
	EList<LocalUseSection> getLocalUseSection();

	/**
	 * Returns the value of the '<em><b>Grid Definition Section</b></em>' containment reference list.
	 * The list contents are of type {@link org.mro.grib.model.files.secondEdition.sections.GridDefinitionSection}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Grid Definition Section</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Grid Definition Section</em>' containment reference list.
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_GridDefinitionSection()
	 * @model containment="true" required="true"
	 * @generated
	 */
	EList<GridDefinitionSection> getGridDefinitionSection();

	/**
	 * Returns the value of the '<em><b>Product Definition Section</b></em>' containment reference list.
	 * The list contents are of type {@link org.mro.grib.model.files.secondEdition.sections.ProductDefinitionSection}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Product Definition Section</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Product Definition Section</em>' containment reference list.
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_ProductDefinitionSection()
	 * @model containment="true" required="true"
	 * @generated
	 */
	EList<ProductDefinitionSection> getProductDefinitionSection();

	/**
	 * Returns the value of the '<em><b>Data Representation Section</b></em>' containment reference list.
	 * The list contents are of type {@link org.mro.grib.model.files.secondEdition.sections.DataRepresentationSection}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Data Representation Section</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Data Representation Section</em>' containment reference list.
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_DataRepresentationSection()
	 * @model containment="true" required="true"
	 * @generated
	 */
	EList<DataRepresentationSection> getDataRepresentationSection();

	/**
	 * Returns the value of the '<em><b>Bit Map Section</b></em>' containment reference list.
	 * The list contents are of type {@link org.mro.grib.model.files.secondEdition.sections.BitMapSection}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Bit Map Section</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Bit Map Section</em>' containment reference list.
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_BitMapSection()
	 * @model containment="true" required="true"
	 * @generated
	 */
	EList<BitMapSection> getBitMapSection();

	/**
	 * Returns the value of the '<em><b>Data Section</b></em>' containment reference list.
	 * The list contents are of type {@link org.mro.grib.model.files.secondEdition.sections.DataSection}.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Data Section</em>' reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Data Section</em>' containment reference list.
	 * @see org.mro.grib.model.files.secondEdition.SecondEditionPackage#getMessage_DataSection()
	 * @model containment="true" required="true"
	 * @generated
	 */
	EList<DataSection> getDataSection();

	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 */
	void buildIndicatorSection(long startOffset, long endOffset, byte edition, long messageLength, byte discipline);
	
	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 */
	void buildIdentificationSection(long startOffset, long endOffset, int length, byte[] binarySection);
	
	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 */
	void addLocalUseSection(long startOffset, long endOffset, int length, byte[] binarySection);
	
	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 * @throws GribException 
	 */
	void addGridDefinitionSection(long startOffset, long endOffset, int length, byte[] binarySection) throws MessageException;
	
	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 * @throws MessageException 
	 */
	void addProductDefinitionSection(long startOffset, long endOffset, int length, byte[] binarySection) throws MessageException;
	
	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 * @throws MessageException 
	 */
	void addDataRepresentationSection(long startOffset, long endOffset, int length, byte[] binarySection) throws MessageException;
	
	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 */
	void addBitMapSection(long startOffset, long endOffset, int length, byte[] binarySection);
	
	/**
	 * 
	 * @param startOffset
	 * @param endOffset
	 * @param length
	 * @param binarySection
	 */
	void addDataSection(long startOffset, long endOffset, int length, byte[] binarySection);
	
} // Message
